home *** CD-ROM | disk | FTP | other *** search
- Path: futures.wharton.upenn.edu!ryan05
- From: ryan05@futures.wharton.upenn.edu (Arthur Ryan)
- Newsgroups: comp.lang.c++
- Subject: Array Assistance Redux
- Date: 17 Jan 1996 19:06:46 GMT
- Organization: University of Pennsylvania
- Message-ID: <4djhc6$pur@netnews.upenn.edu>
- NNTP-Posting-Host: futures.wharton.upenn.edu
- X-Newsreader: TIN [version 1.2 PL2-upenn1.1]
-
- I am trying to load a "CSV" file from my disk in to a two dimensional
- array for manipulation. Right now I'd settle for just verifying the
- array as being filled. The programme compiles fine. But when I run the
- programme the computer just displays 'running' in the status box and I
- have to 'CTRL+Alt+Del' followed by 'Enter' to terminate the freeze up.
- The drive does activate but apart from that I have no indication the
- programme is executing correctly. Help greatly appreciated. Thanks in
- Advance.
-
- Code Below:-
-
-
- #include <iostream.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <fstream.h>
- #include <io.h>
-
-
- disp_menu();
- data_in();
-
- int oda[2][29];
-
- main()
- {
-
- menu and other unproblematic code etc ...
- }
-
- data_in()
- {
- int i,j;
-
- ifstream fsin;
- fsin.open("A:\n&n\test.csv",ios::in);
-
- if(fsin.bad())
- {
- cout << "\n*** Serious I/O error ***\n";
- exit(0);
- }
-
- while (!fsin.eof())
- {
- for (i=0;i<2;i++)
- {
- for(j=0;j<29;j++)
- {
- fsin >> oda [i][j];
- }
- ;
- }
- }
-
- fsin.close();
-
- for (i=0;i<2;i++)
- {
- for (j=0;j<29;j++)
- {
- cout << oda [i][j];
- }
- cout << endl;
- }
-
- return(0);
- }
-
-